package com.luhe.midi.helper;

public class ByteUtil {


    //打印字节数据类型，字节[十六进制]
    public static String printByte(byte bts[]) {
        String s = "";
        for (byte i : bts) {
            s = s + " " + i + "[" + String.format("%02x", (i)) + "] ";
        }
        return s;
    }

    //打印字节数据类型，字节[十六进制]
    public static String printByte(byte bts[], int start, int end) {
        String s = "";
        for (int i = start; i <= end; i = i + 1) {
            s = s + " " + String.format("%02x", (bts[i]))+ " [" +  bts[i] + "] ";
        }
        return s;
    }
}
